﻿using LinqToLfsWorld.Interface;
using System;
using LinqToLfsWorld.Attributes;
using System.Xml.Serialization;
using System.Runtime.Serialization;

namespace LinqToLfsWorld
{
	/// <summary>
	/// Describes a racer's personal best lap around a given track
	/// </summary>
	[Serializable]
	[DataContract]
	public class PersonalBest : ILfsWorldEntity
	{

		/// <summary>
		/// Gets or sets the name of the racer. This property is queryable.
		/// </summary>
		[PubstatQueryable(true)]
		[DataMember]
		public string RacerName { get; set; }

		/// <summary>
		/// Gets or sets the 3-digit track identifier
		/// </summary>
		[DataMember]
		public string TrackIdent { get; set; }

		/// <summary>
		/// Gets the full track name from the <see cref="TrackIdent"/>
		/// </summary>
		[DataMember]
		public string TrackName { get; set; }

		/// <summary>
		/// Gets or sets the car.
		/// </summary>
		[DataMember]
		public string Car { get; set; }

		/// <summary>
		/// Gets or sets the first split time.
		/// </summary>
		[DataMember]
		public TimeSpan Split1 { get; set; }

		/// <summary>
		/// Gets or sets the second split time.
		/// </summary>
		[DataMember]
		public TimeSpan Split2 { get; set; }

		/// <summary>
		/// Gets or sets the third split time.
		/// </summary>
		[DataMember]
		public TimeSpan Split3 { get; set; }

		/// <summary>
		/// Gets or sets the lap time.
		/// </summary>
		/// <value>The lap time.</value>
		[DataMember]
		public TimeSpan LapTime { get; set; }

		/// <summary>
		/// Gets or sets the timestamp of when the personal best was recorded.
		/// </summary>
		[DataMember]
		public DateTime Timestamp { get; set; }

		/// <summary>
		/// Gets or sets the lap count.
		/// </summary>
		[DataMember]
		public int LapCount { get; set; }

	}
}
